package cn.edu.zzu.demo02Thread;

public class TestLambda {

    //2.静态内部类
    static class Like2 implements ILike{

        @Override
        public void say() {
            System.out.println("i like lambda2");
        }
    }

    public static void main(String[] args) {
        //1.内部类
        Like like = new Like();
        like.say();

        //2.静态内部类
        Like2 like2 = new Like2();
        like2.say();

        //3.局部内部类
        class Like3 implements ILike{
            @Override
            public void say() {
                System.out.println("i like lambda3");
            }
        }
        Like3 like3 = new Like3();
        like3.say();

        //4.匿名内部类
        ILike like4 = new ILike() {
            @Override
            public void say() {
                System.out.println("i like lambda4");
            }
        };
        like4.say();

        //5.lambda表达式
        ILike like5 = ()->{
            System.out.println("i like lambda5");
        };
        like5.say();



    }
}

//接口
interface ILike{
    void say();
}

//1.内部类
class Like implements ILike{

    @Override
    public void say() {
        System.out.println("i like lambda1");
    }
}